<section>
    <div class="leftpanel">
        <div class="logopanel">
            <h1><span>[</span>杨毅诊所 <span>]</span></h1>
        </div><!-- logopanel -->
        <div class="leftpanelinner">
            <h5 class="sidebartitle">导航</h5>
            <ul class="nav nav-pills nav-stacked nav-bracket">
                <li class="active"><a ui-sref="index" ng-click="toggleSubMenu($event)"><i class="fa fa-home"></i>
                    <span>首页</span></a></li>

                <li ng-show="menuLoading">
                    <a href="">
                        <i class="fa fa-spinner"></i>
                        <span>{{menuLoadingMessage}}</span>
                    </a>
                </li>
                <li ng-class="{'nav-parent':menu.subMenu.length>0}" ng-repeat="menu in menuList">
                    <!--<a href="" ng-click="toggleSubMenu($event)" ui-sref="{{menu.url}}">-->
                    <a href="" ng-click="toggleSubMenu($event)" ng-click="showPage(menu.url)">
                        <i class="{{menu.icon}}"></i>
                        <span>{{menu.label}}</span>
                    </a>
                    <ul class="children" ng-if="menu.subMenu.length>0">
                        <li ng-repeat="subMenu in menu.subMenu track by $index">
                            <!--<a href="{{subMenu.url}}">-->
                            <a href="" ng-click="showPage(subMenu.url)">
                                <i class="{{subMenu.icon}}"></i>
                                {{subMenu.label}}
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>

        </div><!-- leftpanelinner -->
    </div><!-- leftpanel -->

    <div class="mainpanel">

        <div class="headerbar">

            <a class="menutoggle" ng-click="toggleMenu()"><i class="fa fa-bars"></i></a>

            <div class="header-right">
                <ul class="headermenu">
                    <li>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                <img src="/images/photos/loggeduser.png" alt=""/>
                                杨毅诊所
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                                <li><a ui-sref="login"><i class="glyphicon glyphicon-log-out"></i> 退出</a></li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div><!-- header-right -->

        </div><!-- headerbar -->

        <div ui-view>
            <div class="pageheader">
                <h2><i class="fa fa-home"></i> 药品销售</h2>
                <div class="breadcrumb-wrapper">
                    <span class="label">当前位置:</span>
                    <ol class="breadcrumb">
                        <li class="active">药品销售</li>
                    </ol>
                </div>
            </div>

            <div class="contentpanel">
                <div class="row">
                    <div class="text-center col-lg-9">
                        <input type="text" id="searchCode" placeholder="请使用扫码枪扫描药品编码进行搜索"
                               class="form-control input-lg"
                               tabindex="1" autofocus="autofocus" ng-keyup="search($event,searchCode)"
                               ng-model="searchCode">
                    </div>
                    <div class="col-lg-2">
                        <span class="label label-primary pull-right"
                              style="font-size:25px;line-height:40px;text-align:center;vertical-align: middle">{{totalPrice|currency:'￥'}}</span>
                    </div>
                    <div class="col-lg-1">
                        <button type="button" class="btn btn-lg btn-primary" ng-click="balance()">结算
                        </button>
                    </div>
                </div>
                <br/>

                <table class="table table-condensed table-bordered table-striped table-hover table-success"
                       ng-show="specList.length>0">
                    <thead>
                    <tr>
                        <th>药品名称/药品规格</th>
                        <th>生产厂家</th>
                        <th width="100">数量</th>
                        <th>售价</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="spec in specList">
                        <td><span class="label label-primary" style="font-size:25px">{{spec.medicinalName}}</span>/<span
                                class="label label-success" style="font-size:18px">{{spec.name}}</span></td>
                        <td>{{spec.producerName}}</td>
                        <td>
                            <input type="number" min="1" class="form-control" style="width:100px"
                                   ng-model="spec.saleCount"></td>
                        <td>
                            <span class="label label-danger" style="font-size:25px"
                                  title="{{spec.outPrice*spec.saleCount|currency:'￥'}}={{spec.outPrice}}*{{spec.saleCount}}">{{spec.outPrice*spec.saleCount|currency:'￥'}}</span>
                            <!--<span class="label label-info"> ={{spec.outPrice}}*{{spec.saleCount}}</span>-->
                        </td>
                        <td>
                            <button type="button" class="btn btn-sm btn-danger" ng-click="delete(spec,$index)">删除
                            </button>
                        </td>
                    </tr>
                    <tr class="">
                        <td colspan="3" style="text-align: right">总计</td>
                        <td><span class="label label-primary" style="font-size:25px">{{totalPrice|currency:'￥'}}</span>
                        </td>
                        <td>
                            <button type="button" class="btn btn-lg btn-primary" ng-click="balance()">结算
                            </button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- contentpanel -->

    </div><!-- mainpanel -->

</section>